package com.ruoyi.gas.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gas.mapper.GasCompanyMapper;
import com.ruoyi.gas.domain.GasCompany;
import com.ruoyi.gas.service.IGasCompanyService;

/**
 * 企业信息Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-18
 */
@Service
public class GasCompanyServiceImpl implements IGasCompanyService
{
    @Autowired
    private GasCompanyMapper gasCompanyMapper;

    /**
     * 查询企业信息
     *
     * @param id 企业信息主键
     * @return 企业信息
     */
    @Override
    public GasCompany selectGasCompanyById(Long id)
    {
        return gasCompanyMapper.selectGasCompanyById(id);
    }

    /**
     * 查询企业信息列表
     *
     * @param gasCompany 企业信息
     * @return 企业信息
     */
    @Override
    public List<GasCompany> selectGasCompanyList(GasCompany gasCompany)
    {
        return gasCompanyMapper.selectGasCompanyList(gasCompany);
    }

    /**
     * 新增企业信息
     *
     * @param gasCompany 企业信息
     * @return 结果
     */
    @Override
    public int insertGasCompany(GasCompany gasCompany)
    {
        gasCompany.setCreateTime(DateUtils.getNowDate());
        return gasCompanyMapper.insertGasCompany(gasCompany);
    }

    /**
     * 修改企业信息
     *
     * @param gasCompany 企业信息
     * @return 结果
     */
    @Override
    public int updateGasCompany(GasCompany gasCompany)
    {
        gasCompany.setUpdateTime(DateUtils.getNowDate());
        return gasCompanyMapper.updateGasCompany(gasCompany);
    }

    /**
     * 批量删除企业信息
     *
     * @param ids 需要删除的企业信息主键
     * @return 结果
     */
    @Override
    public int deleteGasCompanyByIds(Long[] ids)
    {
        return gasCompanyMapper.deleteGasCompanyByIds(ids);
    }

    /**
     * 删除企业信息信息
     *
     * @param id 企业信息主键
     * @return 结果
     */
    @Override
    public int deleteGasCompanyById(Long id)
    {
        return gasCompanyMapper.deleteGasCompanyById(id);
    }

    @Override
    public int getCompanyCounts() {
        return gasCompanyMapper.getCompanyCounts();
    }

    @Override
    public List<GasCompany> selectCompanyList() {
        return gasCompanyMapper.selectCompanyList();
    }
}
